package com.example.link.controller;

import com.example.link.service.LinkStatsService;
import lombok.RequiredArgsConstructor;
import com.example.link.model.stats.LinkStatsVO;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author qwert
 * @version 1.0.0
 * @create 2025/8/30 10:17
 **/
@RestController
@RequestMapping("/api/link/stats")
@RequiredArgsConstructor
public class LinkStatsController {
    private final LinkStatsService linkStatsService;
    @GetMapping("")
    public LinkStatsVO getLinkStats(@RequestParam("shortUrl") String shortUrl) {
        return linkStatsService.getLinkStatsByShortUrl(shortUrl);
    }
}
